import request from '../uniHttp';

// 添加菜单
export const createMenu = async (data?: object|any) => {
  return await request('/menu/createMenu', 'post', data);
}

// 获取菜单列表
export const getMenuList = async (data?: object|any) => {
  return await request('/menu/getMenuList', 'post', data);
}

// 获取菜单树
export const getMenuTree = async (id?: string|number) => {
  return await request('/menu/getMenuTree', 'get', id);
}

// 获取菜单
export const getMenu = async (id?: string|number) => {
  return await request('/menu/getMenu', 'get', id);
}

// 修改菜单
export const updateMenu = async (data?: object|any) => {
  return await request('/menu/updateMenu', 'post', data);
}

// 删除菜单
export const deleteMenu = async (id?: string|number) => {
  return await request('/menu/deleteMenu', 'delete', id);
}

// 菜单绑定到角色
export const bindRole = async (data?: object|any) => {
  return await request('/menu/bindRole', 'post', data);
}

// 菜单绑定父子级绑定
export const bindMenu = async (data?: object|any) => {
  return await request('/menu/bindMenu', 'post', data);
}
